-
Notifications
You must be signed in to change notification settings - Fork 224
Ch32x03x i2c sensor example #750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return 0x11; // what does this mean?
return 0x12; // nobody knows
return 0x13; // it's a mystery!|
@unicab369 you have to add a README.md to each of these to explain:
Someone who sees this needs to know how to just use it. |
|
@unicab369 please switch to the other timer mechanism. |
|
ok, I think it's fixed. |
|
Yes, but you now brought in the uart demo that has the stuff we don't want in it timer wise. |
|
@cnlohr sorry, I got my branches mixed up. can we resolve the UART stuff first, then look at this one. |
|
You will need to rebase this branch because of the conflicts. See the message below. |
| u32 get_tickCount() { return SysTick->CNT; } | ||
|
|
||
| void SysTick_Start() { | ||
| SysTick->CTLR = 0x0000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file does not belong in this merge!
|
@unicab369 you still included the uart stuff in this mege request. Please remove it. |
|
@cnlohr how does it look now? I move the i2c into a lib bc it should also works with V10x, v20x, and v30x. |
| // Wait 1ms to see if more data arrives. If no data for 1ms, assume message is complete | ||
| // the wait time may need to be adjusted depending on the baudrate | ||
| if ((millis() - time_ref) > 1) { break;} | ||
| if ((time - time_ref) > 1) { break;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is wrong. Can you test it to make sure it behaves correctly? How does time get updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's wrong, but also, for this you can just sleep.
|
This looks pretty cool now! |

this one was tough, but I learn a lot about I2C.